﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Dialog1.aspx.cs" Inherits="Windows_Dialog1" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
    <head id="Head1" runat="server">
        <title>Ghi chú lỗi của Hồ sơ</title>
        <style type="text/css">
        html, body, form
        {
         padding: 0;
         margin: 0;
         overflow: hidden;
         background: #f2f2de;
        }
        
        body
        {
         font: normal 11px Arial, Verdana, Sans-serif;
        }
        
        fieldset
        {
         height: 180px;
        }
        
        *+html fieldset
        {
         height: 194px;
         width: 262px;
        }
        
        #_radfd_Skinnedclose
        {
         width: 266px !important;
        }
        </style>        
    </head>
    <body>
        <form id="Form2" method="post" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <telerik:RadFormDecorator 
            ID="RadFormDecorator1" 
            DecoratedControls="All" 
            runat="server" 
            Skin="Sunset" />

        <script type="text/javascript">
        function GetRadWindow()
        {
            var oWindow = null;
            if (window.radWindow) oWindow = window.radWindow;
            else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;
            return oWindow;
        }
        
        function openWin2()
        {
            var parentPage = GetRadWindow().BrowserWindow;
            var parentRadWindowManager = parentPage.GetRadWindowManager();
            var oWnd2 = parentRadWindowManager.open("Dialog2.aspx","RadWindow2");
            window.setTimeout(function()
            {
                oWnd2.setActive(true); 
            },0);
        }
        
        function populateCityName(arg)
        {
           var cityName = document.getElementById("cityName");
           cityName.value = arg;
        }
        
        function returnToParent()
        {
             //create the argument that will be returned to the parent page
             var oArg = new Object();
            
            //get the city's name 
            oArg.cityName = document.getElementById("cityName").value;
            
            //get the selected date from RadDatePicker
            var notecomment = $find("<%= NoteComment.ClientID %>"); 
            oArg.selDate = datePicker.get_selectedDate().toLocaleDateString();
                                                      
            //get a reference to the current RadWindow
            var oWnd = GetRadWindow();
            
            
            
            
            //Close the RadWindow and send the argument to the parent page
            if(oArg.selDate && oArg.cityName)
            {
                oWnd.close(oArg);
            }
            else
            {
                alert("Please fill both fields"); 
            } 
        }
        </script>
        <fieldset id="fld1">
            <legend>Ghi chú lỗi</legend>            
            <div style="margin: 5px 0 0 0;">                
                <textarea style="width:250px; height:150px" id="NoteComment" runat="server"></textarea>                
            </div>
        </fieldset>
        <div style="margin-top: 4px; text-align:right;">
            <button title="Submit" style="margin-top: 26px;" id="close" onclick="returnToParent(); return false;">
            OK</button>
            <button title="Cancel" style="margin-top: 26px;" id="Cancle">
            Cancel</button>
        </div>
        </form>
    </body>
</html>
